package com.op.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * (Menu)表实体类
 *
 * @author 孤焰
 * @since 2021-12-25 15:27:28
 */
@Data
@ApiModel("Menu")
public class Menu implements Serializable {
    private static final long serialVersionUID = -33220902210998606L;

    @ApiModelProperty("主键id")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("菜单中文名")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String name;

    @ApiModelProperty("父菜单id")
    private Long parentId;

    @ApiModelProperty("菜单类型(L目录 M菜单 B按钮 )  多个类型之间用:分割")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String type;

    @ApiModelProperty("路由地址")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String path;

    @ApiModelProperty("路由参数")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String query;

    @ApiModelProperty("组件路径")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String component;

    @ApiModelProperty("授权code")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String permission;

    @ApiModelProperty("排序字段，数字越小优先级越大")
    private Integer sort;

    @ApiModelProperty("菜单图标")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String icon;

    @ApiModelProperty("菜单状态（1显示 0隐藏）")
    private Integer visible;

    @ApiModelProperty("菜单状态（1正常 0停用）")
    private Integer status;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新时间")
    private Date modifyTime;

    @ApiModelProperty("子菜单")
    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Menu> children;
}

